import request from '@/utils/request'


export function listAuitvo(query) {
  return request({
    url: '/system/employeefiles/empList',
    method: 'get',
    params: query
  })
}

// 查询员工档案列表
export function listEmployeefiles(query) {
  return request({
    url: '/system/employeefiles/list',
    method: 'get',
    params: query
  })
}


// 查询待增员
export function listAdd(query) {
  return request({
    url: '/system/employeefiles/listAdd',
    method: 'get',
    params: query
  })
}

// 查询合同列表
export function listContract(query) {
  return request({
    url: '/system/employeefiles/contractList',
    method: 'get',
    params: query
  })
}

export function selectRoster(query) {
  return request({
    url: '/system/employeefiles/roster',
    method: 'get',
    params: query
  })
}

// 查询试用员工列表
export function listRoster(query) {
  return request({
    url: '/system/employeefiles/rosterList',
    method: 'get',
    params: query
  })
}

// 查询正式员工列表
export function rosterFormalList(query) {
  return request({
    url: '/system/employeefiles/rosterFormalList',
    method: 'get',
    params: query
  })
}

// 查询离职员工列表
export function rosterQuitList(query) {
  return request({
    url: '/system/employeefiles/rosterQuitList',
    method: 'get',
    params: query
  })
}

// 查询员工档案详细
export function getEmployeefiles(id) {
  return request({
    url: '/system/employeefiles/' + id,
    method: 'get'
  })
}

export function getContract(id) {
  return request({
    url: '/system/employeefiles/getContract/' + id,
    method: 'get'
  })
}

// 新增材料附件
export function addEnclosure(data) {
  return request({
    url: '/system/enclosure',
    method: 'post',
    data: data
  })
}

export function upload(img) {
  return request({
    url: '/system/employeefiles/upload',
    data: img,
    method: 'post'
  })
}

// 查询员工合同信息
export function getEidByCid(id) {
  return request({
    url: '/system/employeefiles/getEidByCid/' + id,
    method: 'get'
  })
}

export function beforeAvatarUpload(file) {
  return request({
    url: '/system/employeefiles/upload/' + file,
    method: 'get'
  })
}


// 办理离职
export function giveUp(id, leavingReason, remarks, updateTime) {
  return request({
    url: '/system/employeefiles/giveUp/' + id + '/' + leavingReason + '/' + remarks + '/' + updateTime,
    method: 'get',
  })
}

// 统计数量
export function statisticsNum() {
  return request({
    url: '/system/employeefiles/statisticsNum',
    method: 'get'

  })
}

// 新增员工档案
export function addEmployeefiles(data) {
  return request({
    url: '/system/employeefiles',
    method: 'post',
    data: data
  })
}

// 修改员工档案
export function updateEmployeefiles(data) {
  return request({
    url: '/system/employeefiles',
    method: 'put',
    data: data
  })
}

// 删除员工档案
export function delEmployeefiles(id) {
  return request({
    url: '/system/employeefiles/' + id,
    method: 'delete'
  })
}


export function insertEmpForm(data) {
  return request({
    url: '/system/employeefiles/insertEmpForm',
    method: 'post',
    data: data
  })
}
